CC = gcc
CXX = g++
LINK = g++
.PHONY : all clean install uninstall
all : bin/src bin/src/main.o bin/libasystem.so
bin/src :
	mkdir -p bin/src
bin/src/main.o : src/main.cpp include/asystem.h
	$(CXX) -c -O2 -o bin/src/main.o -Iinclude src/main.cpp
bin/libasystem.so : bin/src/main.o
	$(LINK) -O2 --shared -o bin/libasystem.so bin/src/main.o
clean :
	rm -rf bin
install : all
	cp bin/libasystem.so /usr/lib
	cp include/asystem.h /usr/include
	ldconfig
uninstall :
	rm /usr/lib/libasystem.so
	rm /usr/include/asystem.h
	ldconfig